package club.gskj.gulimall.product.service;

import club.gskj.gulimall.product.vo.AttrGroupRelationVo;
import club.gskj.gulimall.product.vo.AttrRespVo;
import club.gskj.gulimall.product.vo.AttrVo;
import com.baomidou.mybatisplus.extension.service.IService;
import club.gskj.common.utils.PageUtils;
import club.gskj.gulimall.product.entity.AttrEntity;

import java.util.List;
import java.util.Map;

/**
 * 商品属性
 *
 * @author 康纳-connor
 * @email 2417039231@gmail.com
 * @date 2020-12-27 15:07:43
 */
public interface AttrService extends IService<AttrEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void save(AttrVo attr);

    PageUtils queryBaseAttrPage(Long catelogId, Map<String, Object> params, String pathType);

    /**
     * 获取 attr 详细信息
     *
     * @param attrId
     * @return
     */
    AttrRespVo getAttrInfo(Long attrId);

    /**
     * 修改 attr以及级联表信息
     *
     * @param attr
     */
    void updateAttrVo(AttrVo attr);

    /***
     *   查询分组关联的 属性列表
     * @param groupId
     * @return
     */
    List<AttrEntity> ListRelationAttr(Long groupId);

    void deleteAttrRelations(AttrGroupRelationVo[] vos);

    PageUtils ListNotRelationAttr(Long groupId, Map<String, Object> params);

    /***
     *  根据attrId 过滤出可以检索的attrId
     * @param attrIds
     * @return
     */
    List<Long> listSearchAttrIds(List<Long> attrIds);
}

